<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Text文本的操作</title>
</head>
<body>
<div id="div"></div>
</body>
<script>
    //innerText   添加文本内容，不解析标签
    let div=document.getElementById("div");
    div.innerText="111"

    //innerHTML   添加文本内容，解析标签
    div.innerHTML = "<b>222</b>"

</script>
</html>